package org.minproject.my_library_back.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName buy
 */
@TableName(value ="buy")
@Data
public class Buy implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer buyId;

    /**
     * 
     */
    private Integer userFromId;

    /**
     * 
     */
    private Integer userToId;

    /**
     * 
     */
    private String libraryName;

    /**
     * 
     */
    private Date buyTime1;

    /**
     * 
     */
    private Date buyTime2;

    /**
     * 
     */
    private Integer buyNum;

    /**
     * 
     */
    private String buyLocation;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Buy other = (Buy) that;
        return (this.getBuyId() == null ? other.getBuyId() == null : this.getBuyId().equals(other.getBuyId()))
            && (this.getUserFromId() == null ? other.getUserFromId() == null : this.getUserFromId().equals(other.getUserFromId()))
            && (this.getUserToId() == null ? other.getUserToId() == null : this.getUserToId().equals(other.getUserToId()))
            && (this.getLibraryName() == null ? other.getLibraryName() == null : this.getLibraryName().equals(other.getLibraryName()))
            && (this.getBuyTime1() == null ? other.getBuyTime1() == null : this.getBuyTime1().equals(other.getBuyTime1()))
            && (this.getBuyTime2() == null ? other.getBuyTime2() == null : this.getBuyTime2().equals(other.getBuyTime2()))
            && (this.getBuyNum() == null ? other.getBuyNum() == null : this.getBuyNum().equals(other.getBuyNum()))
            && (this.getBuyLocation() == null ? other.getBuyLocation() == null : this.getBuyLocation().equals(other.getBuyLocation()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBuyId() == null) ? 0 : getBuyId().hashCode());
        result = prime * result + ((getUserFromId() == null) ? 0 : getUserFromId().hashCode());
        result = prime * result + ((getUserToId() == null) ? 0 : getUserToId().hashCode());
        result = prime * result + ((getLibraryName() == null) ? 0 : getLibraryName().hashCode());
        result = prime * result + ((getBuyTime1() == null) ? 0 : getBuyTime1().hashCode());
        result = prime * result + ((getBuyTime2() == null) ? 0 : getBuyTime2().hashCode());
        result = prime * result + ((getBuyNum() == null) ? 0 : getBuyNum().hashCode());
        result = prime * result + ((getBuyLocation() == null) ? 0 : getBuyLocation().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", buyId=").append(buyId);
        sb.append(", userFromId=").append(userFromId);
        sb.append(", userToId=").append(userToId);
        sb.append(", libraryName=").append(libraryName);
        sb.append(", buyTime1=").append(buyTime1);
        sb.append(", buyTime2=").append(buyTime2);
        sb.append(", buyNum=").append(buyNum);
        sb.append(", buyLocation=").append(buyLocation);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}